import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '所属部门',
    align: "center",
    dataIndex: 'sysOrgCode'
  },
  {
    title: '视频名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '视频地址',
    align: "center",
    dataIndex: 'vedio',
  },
  {
    title: '描述',
    align: "center",
    dataIndex: 'detail'
  },
  {
    title: '封面图',
    align: "center",
    dataIndex: 'cover',
    customRender: render.renderImage,
  },
  {
    title: '价格',
    align: "center",
    dataIndex: 'price'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "所属部门",
    field: 'sysOrgCode',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "视频名称",
    field: 'name',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '视频名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '视频地址',
    field: 'vedio',
    component: 'JUpload',
    componentProps:{
     },
  },
  {
    label: '描述',
    field: 'detail',
    component: 'Input',
  },
  {
    label: '封面图',
    field: 'cover',
    component: 'JImageUpload',
    componentProps:{
    },
  },
  {
    label: '价格',
    field: 'price',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  sysOrgCode: {title: '所属部门',order: 0,view: 'text', type: 'string',},
  name: {title: '视频名称',order: 1,view: 'text', type: 'string',},
  vedio: {title: '视频地址',order: 2,view: 'file', type: 'string',},
  detail: {title: '描述',order: 3,view: 'text', type: 'string',},
  cover: {title: '封面图',order: 4,view: 'image', type: 'string',},
  price: {title: '价格',order: 5,view: 'number', type: 'number',},
};
